577. 员工奖金
# Write your MySQL query statement below
select
    name,
    ifnull(bonus,null) as bonus
from
    Employee left join Bonus on Employee.empid = Bonus.empid
where 
    bonus < 1000 or bonus is null

面试题 02.04. 分割链表
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode() : val(0), next(nullptr) {}
 *     ListNode(int x) : val(x), next(nullptr) {}
 *     ListNode(int x, ListNode *next) : val(x), next(next) {}
 * };
 */
class Solution {
public:
    ListNode* partition(ListNode* head, int x) 
    {
        ListNode* faster=head;
        ListNode* slower=head;
        while(faster!=nullptr&&slower!=nullptr)
        {
            if(slower->val>=x&&faster->val<x)
            {
                int tmp=slower->val;
                slower->val = faster->val;
                faster->val = tmp;
            }

            if(slower->val<x)
            {
                slower=slower->next;
            }
            faster=slower;
            while(faster!=nullptr&&faster->val>=x)
            {

                faster=faster->next;
            }

            
        }    
        return head;
    }
};

228. 汇总区间
class Solution {
public:
    string MakeRange(int begin,int end)
    {
        string s="";
        if(begin!=end)
        {
            s+=to_string(begin);
            s+="->";
            s+=to_string(end);
        }
        else 
        {
            s+=to_string(begin);
        }
        return s;
    }

    vector<string> summaryRanges(vector<int>& nums) 
    {
        if(nums.size()==0)
        {
            return {};
        }
        vector<string> ret;
        int begin = nums[0];
        int end = nums[0];
        for(int i=1;i<nums.size();i++)
        {
            if(nums[i]-1==end)
            {
                end = nums[i];
            }
            else 
            {
                ret.push_back(MakeRange(begin,end));
                end=begin=nums[i];
            }   
        }   
        ret.push_back(MakeRange(begin,end));
        return ret; 
    }
};